package com.ruoyi.alarm.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.alarm.mapper.AlarmDeviceMapper;
import com.ruoyi.alarm.domain.AlarmDevice;
import com.ruoyi.alarm.service.IAlarmDeviceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备报警信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-04
 */
@Service
public class AlarmDeviceServiceImpl implements IAlarmDeviceService 
{
    @Autowired
    private AlarmDeviceMapper alarmDeviceMapper;

    /**
     * 查询设备报警信息
     * 
     * @param alarmGroup 设备报警信息主键
     * @return 设备报警信息
     */
    @Override
    public AlarmDevice selectAlarmDeviceByAlarmGroup(String alarmGroup)
    {
        return alarmDeviceMapper.selectAlarmDeviceByAlarmGroup(alarmGroup);
    }

    /**
     * 查询设备报警信息列表
     * 
     * @param alarmDevice 设备报警信息
     * @return 设备报警信息
     */
    @Override
    public List<AlarmDevice> selectAlarmDeviceList(AlarmDevice alarmDevice)
    {
        return alarmDeviceMapper.selectAlarmDeviceList(alarmDevice);
    }

    /**
     * 新增设备报警信息
     * 
     * @param alarmDevice 设备报警信息
     * @return 结果
     */
    @Override
    public int insertAlarmDevice(AlarmDevice alarmDevice)
    {
        return alarmDeviceMapper.insertAlarmDevice(alarmDevice);
    }

    /**
     * 修改设备报警信息
     * 
     * @param alarmDevice 设备报警信息
     * @return 结果
     */
    @Override
    public int updateAlarmDevice(AlarmDevice alarmDevice)
    {
        return alarmDeviceMapper.updateAlarmDevice(alarmDevice);
    }

    /**
     * 批量删除设备报警信息
     * 
     * @param alarmGroups 需要删除的设备报警信息主键
     * @return 结果
     */
    @Override
    public int deleteAlarmDeviceByAlarmGroups(String alarmGroups)
    {
        return alarmDeviceMapper.deleteAlarmDeviceByAlarmGroups(Convert.toStrArray(alarmGroups));
    }

    /**
     * 删除设备报警信息信息
     * 
     * @param alarmGroup 设备报警信息主键
     * @return 结果
     */
    @Override
    public int deleteAlarmDeviceByAlarmGroup(String alarmGroup)
    {
        return alarmDeviceMapper.deleteAlarmDeviceByAlarmGroup(alarmGroup);
    }
}
